img_path='Samples\0001';
% img_path_r='D:\dataset\IITD\LeftHand';
% img_path='D:\dataset\IITD\RightHand';
num_classes=8;
offset=150;
roisize=256;
addpath(img_path);
addpath('Functions\DetectROI');
addpath('Functions\bemd');
ROIL=repmat(struct('image',uint8(zeros(roisize,roisize))),1,8);
ROIR=repmat(struct('image',uint8(zeros(roisize,roisize))),1,8);
tform=maketform('affine',[0 1 0;1 0 0;0 0 1]);
% A=imtransform(I,tform,'nearest');
for i=1:num_classes
%     ROIL(i).image=findROI(img_path, ['\002_' num2str(i) '.jpg'],roisize,offset);
    ROIL(i).image=findROI(img_path, ['\0001_m_l_0' num2str(i) '.jpg'],roisize,offset);
%     ROIR(i).image=findROI(img_path_r, ['\002_' num2str(i) '.jpg'],roisize,offset);
    ROIR(i).image=findROI(img_path, ['\0001_m_r_0' num2str(i) '.jpg'],roisize,offset);
end
%%
figure;
suptitle('ROI - Left Hand');
for i=1:num_classes
    subplot(2,4,i)
    imshow(ROIL(i).image);
    title(['ROI of im 0' num2str(i) '.jpg']);
end
figure;
suptitle('ROI - Right Hand');
for j=1:num_classes
    subplot(2,4,j)
    imshow(ROIR(j).image);
    title(['ROI of im 0' num2str(j) '.jpg']);
end
%% edge detection
% figure;
% suptitle('Edges - Left Hand');
% for i=1:num_classes
%     subplot(2,4,i)
%     imL_bf_filter=edge(ROIL(i).image,'sobel');
%     imL_af_filter=bwmorph(imL_bf_filter,'bridge');
%     imshow(imL_af_filter);
%     title(['Edges of im 0' num2str(i) '.jpg']);
% end
% figure;
% suptitle('Edges - Right Hand');
% for j=1:num_classes
%     subplot(2,4,j)
%     imR_bf_filter=edge(ROIR(j).image,'sobel');
%     imR_af_filter=bwmorph(imR_bf_filter,'bridge');
%     imshow(imR_af_filter);
%     title(['Edges of im 0' num2str(j) '.jpg']);
% end